﻿@* Ui层项目 - 路由模块文件 *@
@using Util.Generators.Helpers
@model Util.Generators.Contexts.EntityContext
@{
    var service = new GenerateService( Model );
    Model.Output.FileNameNoExtension = service.GetClientRoutingModuleFileName();
    Model.Output.Extension = ".ts";
    Model.Output.RelativeRootPath = $"src/{service.GetClientModulePath()}";
}
import { NgModule } from '@@angular/core';
import { RouterModule, Routes } from '@@angular/router';
@foreach (var entity in service.GetEntities()) {
<text>import { @service.GetClientListClassName(entity) } from './@service.GetClientEntityFileName(entity)/@(service.GetClientListFileName( entity ))';
</text>
}

//路由配置
export const routes: Routes = [
    {
        path: '',
        children: [
@foreach (var entity in service.GetEntities()) {
<text>           { path: '@service.GetClientEntityFileName(entity)', component: @service.GetClientListClassName(entity) },
</text>
}
       ]
    }
];

/**
 * @(Model.ProjectContext.Client.AppName)路由模块
 */
@@NgModule( {
    imports: [RouterModule.forChild( routes )]
} )
export class @service.GetClientRoutingModuleClassName() { }
